package com.hzit.order.controller;

import com.hzit.paycommon.paycommonapi.resp.PayNotifyData;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 接收支付服务的异步回调
 */
@RestController
@RequestMapping("/notify")
public class NotifyController {

    /**
     * 支付回调
     * @return
     */
    @RequestMapping(value = "/payReceive",method = RequestMethod.POST)
    public String receive(@RequestBody PayNotifyData payNotifyData, HttpServletResponse response){
        System.out.println("---------接收支付服务的异步回调 = [" + payNotifyData+ "]...");

        //1.接收支付服务的回调参数。

        //2.验签

        //3.判断

        //4.更新订单

        //5.响应结果
        return "fail";
    }
}
